﻿<r:RibbonWindow x:Class="ActiveStoryTouch.UI.MainWindow"
		xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"  
		xmlns:pg="clr-namespace:WPG;assembly=WPG"  
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:Commands="clr-namespace:ActiveStoryTouch.UI.Commands"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        d:DataContext="{d:DesignData DesignerSampleData/SampleMainWindowDataContext.xaml}"
		Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded" WindowStyle="SingleBorderWindow" IconVisibility="Visible" MinWidth="1024" MinHeight="768" Icon="Content/icon.png">
    <!--xmlns:pg="clr-namespace:WpfPropertyGrid;assembly=WpfPropertyGrid"-->
    <r:RibbonWindow.Background>
        <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
    </r:RibbonWindow.Background>
    <Window.CommandBindings>
        <!--Ribbon Commands-->
        <CommandBinding x:Name="NewProjectRibbonCommandBinding" Command="Commands:RibbonUICommands.NewProject" Executed="NewProjectCommandBinding_Executed" CanExecute="NewProjectCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="OpenProjectRibbonCommandBinding" Command="Commands:RibbonUICommands.OpenProject" Executed="OpenProjectCommandBinding_Executed" CanExecute="OpenProjectCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="SaveProjectRibbonCommandBinding" Command="Commands:RibbonUICommands.SaveProject" Executed="SaveProjectCommandBinding_Executed" CanExecute="SaveProjectCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="ExportProjectRibbonCommandBinding" Command="Commands:RibbonUICommands.ExportProject" Executed="ExportProjectCommandBinding_Executed" CanExecute="ExportProjectCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="ExportPageRibbonCommandBinding" Command="Commands:RibbonUICommands.ExportPageToImage" Executed="ExportProjectCommandBinding_Executed" CanExecute="ExportProjectCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="ExportAllPagesRibbonCommandBinding" Command="Commands:RibbonUICommands.ExportAllToImage" Executed="ExportProjectCommandBinding_Executed" CanExecute="ExportProjectCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="ExportWoZRibbonCommandBinding" Command="Commands:RibbonUICommands.ExportToWizardOfOz" Executed="ExportProjectCommandBinding_Executed" CanExecute="ExportProjectCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="ExitActiveStoryRibbonCommandBinding" Command="Commands:RibbonUICommands.ExitActiveStory" Executed="ExitActiveStoryCommandBinding_Executed" CanExecute="ExitActiveStoryCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="DrawModeRibbonCommandBinding" Command="Commands:RibbonUICommands.DrawMode" Executed="DrawModeCommandBinding_Executed" CanExecute="DrawModeCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="PointEraserModeRibbonCommandBinding" Command="Commands:RibbonUICommands.PointEraserMode" Executed="PointEraserModeCommandBinding_Executed" CanExecute="PointEraserModeCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="StrokeEraserModeRibbonCommandBinding" Command="Commands:RibbonUICommands.StrokeEraserMode" Executed="StrokeEraserModeCommandBinding_Executed" CanExecute="StrokeEraserModeCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="SelectionModeRibbonCommandBinding" Command="Commands:RibbonUICommands.SelectionMode" Executed="SelectionModeCommandBinding_Executed" CanExecute="SelectionModeCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="CreateLinkRibbonCommandBinding" Command="Commands:RibbonUICommands.CreateLink" Executed="CreateLinkCommandBinding_Executed" CanExecute="CreateLinkCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="RemoveLinkRibbonCommandBinding" Command="Commands:RibbonUICommands.RemoveLink" Executed="RemoveLinkCommandBinding_Executed" CanExecute="RemoveLinkCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="ImportImageRibbonCommandBinding" Command="Commands:RibbonUICommands.ImportImage" Executed="ImportImageCommandBinding_Executed" CanExecute="ImportImageCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="AddPageRibbonCommandBinding" Command="Commands:RibbonUICommands.AddPage" Executed="AddPageCommandBinding_Executed" CanExecute="AddPageCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="DeletePageRibbonCommandBinding" Command="Commands:RibbonUICommands.DeletePage" Executed="DeletePageCommandBinding_Executed" CanExecute="DeletePageCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="CarbonCopyPageRibbonCommandBinding" Command="Commands:RibbonUICommands.CarbonCopyPage" Executed="CarbonCopyPageCommandBinding_Executed" CanExecute="CarbonCopyPageCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="RenamePageRibbonCommandBinding" Command="Commands:RibbonUICommands.RenamePage" Executed="RenamePageCommandBinding_Executed" CanExecute="RenamePageCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="SetPenColorRibbonCommandBinding" Command="Commands:RibbonUICommands.SetPenColor" Executed="SetPenColorCommandBinding_Executed" CanExecute="SetPenColorCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="SetCanvasSizeRibbonCommandBinding" Command="Commands:RibbonUICommands.SetCanvasSize" CanExecute="SetCanvasSizeCommandBinding_CanExecute" Executed="SetCanvasSizeCommandBinding_Executed"></CommandBinding>
        <CommandBinding x:Name="AboutRibbonCommandBinding" Command="Commands:RibbonUICommands.About" Executed="AboutCommandBinding_Executed"></CommandBinding>
        <CommandBinding x:Name="UndoRibbonCommandBinding" Command="Commands:RibbonUICommands.Undo" Executed="UndoCommandBinding_Executed" CanExecute="UndoCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="RedoRibbonCommandBinding" Command="Commands:RibbonUICommands.Redo" Executed="RedoCommandBinding_Executed" CanExecute="RedoCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="BlueStyleRibbonCommandBinding" Command="Commands:RibbonUICommands.BlueRibbon" Executed="BlueRibbonStyleCommandBinding_Executed" CanExecute="BlueRibbonStyleCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="BlackStyleRibbonCommandBinding" Command="Commands:RibbonUICommands.BlackRibbon" Executed="BlackRibbonStyleCommandBinding_Executed" CanExecute="BlackRibbonStyleCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="SilverStyleRibbonCommandBinding" Command="Commands:RibbonUICommands.SilverRibbon" Executed="SilverRibbonStyleCommandBinding_Executed" CanExecute="SilverRibbonStyleCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="Win7StyleRibbonCommandBinding" Command="Commands:RibbonUICommands.Win7Ribbon" Executed="Win7RibbonStyleCommandBinding_Executed" CanExecute="Win7RibbonStyleCommandBinding_CanExecute"></CommandBinding>
        <CommandBinding x:Name="ChangeDefaultCanvasColorRibbonCommandBinding" Command="Commands:RibbonUICommands.ChangeDefaultCanvasColor" CanExecute="ChangeDefaultCanvasColorCommandBinding_CanExecute" Executed="ChangeDefaultCanvasColorCommandBinding_Executed"></CommandBinding>
        <CommandBinding x:Name="ChangeCurrentCanvasColorRibbonCommandBinding" Command="Commands:RibbonUICommands.ChangeCurrentCanvasColor" Executed="ChangeCurrentCanvasColorCommandBinding_Executed" CanExecute="ChangeCurrentCanvasColorCommandBinding_CanExecute"></CommandBinding>
    </Window.CommandBindings>
    <DockPanel Name="LayoutRoot" LastChildFill="True">
        <!--Top panel, Menu-->
        <DockPanel DockPanel.Dock="Top">
            <Expander DockPanel.Dock="Bottom" ExpandDirection="Down" Header="Pen Palette" IsExpanded="True">
                <Expander.BorderBrush>
                    <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                </Expander.BorderBrush>
                <Expander.Background>
                    <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                </Expander.Background>
                <Grid Name="BottomPanel" DockPanel.Dock="Bottom" Height="79">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="160" />
                        <ColumnDefinition Width="5" />
                        <ColumnDefinition Width="160" />
                        <ColumnDefinition Width="5" />
                        <ColumnDefinition Width="50" />
                        <ColumnDefinition Width="5" />
                        <ColumnDefinition Width="160" />
                        <ColumnDefinition Width="5" />
                        <ColumnDefinition />
                        <ColumnDefinition Width="0" />
                        <!--5-->
                        <ColumnDefinition Width="0"/>
                        <!--150-->
                    </Grid.ColumnDefinitions>
                    <Border Grid.Column="0" BorderThickness="1" CornerRadius="5,5,5,5">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                        </Border.BorderBrush>
                        <StackPanel HorizontalAlignment="Left" Orientation="Vertical">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="30"/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="30"/>
                                </Grid.ColumnDefinitions>
                                <Image Grid.Column="0" Height="10" HorizontalAlignment="Center" Source="Content/SmallBrushSize.png"/>
                                <Label Grid.Column="1" HorizontalAlignment="Center">Pen Size</Label>
                                <Image Grid.Column="2" Height="15" HorizontalAlignment="Center" Source="Content/BigBrushSize.png"/>
                            </Grid>
                            <StackPanel Orientation="Horizontal">
                                <Label Width="48">Width:</Label>
                                <Slider Name="PenWidthSlider" HorizontalAlignment="Left" VerticalAlignment="Center" Width="105" Value="{Binding ElementName=PageInkCanvas, Path=DefaultDrawingAttributes.Width, Mode=TwoWay}" TabIndex="9" Style="{DynamicResource GraySliderStyle}"></Slider>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <Label Width="48">Height:</Label>
                                <Slider Name="PenHeightSlider" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="105" Value="{Binding ElementName=PageInkCanvas, Path=DefaultDrawingAttributes.Height, Mode=TwoWay}" TabIndex="10" Style="{DynamicResource GraySliderStyle}"></Slider>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="2" BorderThickness="1" CornerRadius="5,5,5,5">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                        </Border.BorderBrush>
                        <StackPanel HorizontalAlignment="Center">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="30"/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="30"/>
                                </Grid.ColumnDefinitions>
                                <Image Grid.Column="0" Height="12" HorizontalAlignment="Center" Source="Content/EraserSizeImage.png"/>
                                <Label Grid.Column="1" HorizontalAlignment="Center">Eraser Size</Label>
                                <Image Grid.Column="2" Height="20" HorizontalAlignment="Center" Source="Content/EraserSizeImage.png"/>
                            </Grid>
                            <StackPanel Orientation="Horizontal">
                                <Label Width="48">Width:</Label>
                                <Slider Name="EraserWidthSlider" Value="{Binding Mode=TwoWay,Path=ActivePenSettings.EraserWidth}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="105"  Maximum="25" TabIndex="11" Style="{DynamicResource GraySliderStyle}"></Slider>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <Label Width="48">Height:</Label>
                                <Slider Name="EraserHeightSlider" Value="{Binding  Mode=TwoWay,Path=ActivePenSettings.EraserHeight}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="105"  Maximum="25" TabIndex="12" Style="{DynamicResource GraySliderStyle}"></Slider>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="4" BorderThickness="1" CornerRadius="5">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                        </Border.BorderBrush>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Label Grid.Row="0" HorizontalContentAlignment="Center">Shape</Label>

                            <RadioButton Style="{DynamicResource ToggleRadioButtonStyle}" Name="CirclePenShapeToggleButton" Grid.Row="2" IsChecked="True" Checked="CirclePenShapeToggleButton_Checked">
                                <RadioButton.BorderBrush>
                                    <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                                </RadioButton.BorderBrush>
                                <RadioButton.Background>
                                    <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                                </RadioButton.Background>
                                <Ellipse Height="18" Width="18" Stroke="Black" Fill="Black"></Ellipse>
                            </RadioButton>
                            <RadioButton Style="{DynamicResource ToggleRadioButtonStyle}" Name="RectPenShapeToggleButton" Grid.Row="4" Checked="RectPenShapeToggleButton_Checked">
                                <RadioButton.BorderBrush>
                                    <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                                </RadioButton.BorderBrush>
                                <RadioButton.Background>
                                    <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                                </RadioButton.Background>
                                <Rectangle Height="18" Width="18" Stroke="Black" Fill="Black"></Rectangle>
                            </RadioButton>
                            <!--
                            <ToggleButton Name="CirclePenShapeToggleButton" Grid.Row="2" Background="Transparent" BorderBrush="Transparent" IsChecked="True" Checked="CirclePenShapeToggleButton_Checked">
                                <Ellipse Height="18" Width="18" Stroke="Black" Fill="Black"></Ellipse>
                            </ToggleButton>
                            <ToggleButton Name="RectPenShapeToggleButton" Grid.Row="4" Background="Transparent" BorderBrush="Transparent" Checked="RectPenShapeToggleButton_Checked">
                                <Rectangle Height="18" Width="18" Stroke="Black" Fill="Black"></Rectangle>
                            </ToggleButton>-->
                        </Grid>
                    </Border>

                    <Border Grid.Column="6" BorderThickness="1" CornerRadius="5">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                        </Border.BorderBrush>
                        <StackPanel HorizontalAlignment="Left" Orientation="Vertical" Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Border}},Path=ActualWidth}">
                            <Label Content="Pen Tip" HorizontalContentAlignment="Center"></Label>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Label Grid.Column="0">Rotate:</Label>

                                <DockPanel Grid.Column="1" LastChildFill="True">
                                    <Label DockPanel.Dock="Left">0</Label>
                                    <Label DockPanel.Dock="Right">π</Label>
                                    <Slider Name="PenRotationSlider" Grid.Column="1" Minimum="0" Maximum="180" Value="{Binding Mode=TwoWay,Path=ActivePenSettings.PenRotation}" Style="{DynamicResource GraySliderStyle}"></Slider>
                                </DockPanel>

                                <Label Grid.Column="0" Grid.Row="1">Skew:</Label>
                                <DockPanel Grid.Column="1" Grid.Row="1" LastChildFill="True">
                                    <Label DockPanel.Dock="Left">L</Label>
                                    <Label DockPanel.Dock="Right">R</Label>
                                    <Slider Name="PenSkewSlider" Grid.Column="1" Minimum="-44" Maximum="44" Value="{Binding Mode=TwoWay,Path=ActivePenSettings.PenSkew}" Style="{DynamicResource GraySliderStyle}"></Slider>
                                </DockPanel>
                            </Grid>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="8" BorderThickness="1" CornerRadius="5,5,5,5">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                        </Border.BorderBrush>
                        <Grid Name="ColorGrid">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="45" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="45" />
                                <ColumnDefinition Width="150" />
                            </Grid.ColumnDefinitions>
                            <Label Grid.Column="0" Grid.Row="1">Color</Label>
                            <Label Grid.Column="2" Grid.Row="0">Red</Label>
                            <Grid Grid.Column="3" Grid.Row="0" >
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="20"/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="30"/>
                                </Grid.ColumnDefinitions>
                                <Label Grid.Column="0">0</Label>
                                <Slider Name="ColorRedSlider" Grid.Column="1" Width="Auto" Maximum="255" TabIndex="14" Value="{Binding Mode=TwoWay,Path=ActivePenSettings.PenColorRed}" Style="{DynamicResource GraySliderStyle}"></Slider>
                                <Label Grid.Column="2">255</Label>
                            </Grid>
                            <Label Grid.Column="2" Grid.Row="1">Green</Label>
                            <Grid Grid.Column="3" Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="20"/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="30"/>
                                </Grid.ColumnDefinitions>
                                <Label Grid.Column="0">0</Label>
                                <Slider Name="ColorGreenSlider" Grid.Column="1" Width="Auto" Maximum="255" TabIndex="15" Value="{Binding Mode=TwoWay,Path=ActivePenSettings.PenColorGreen}" Style="{DynamicResource GraySliderStyle}"></Slider>
                                <Label Grid.Column="2">255</Label>
                            </Grid>
                            <Label Grid.Column="2" Grid.Row="2">Blue</Label>
                            <Grid Grid.Column="3" Grid.Row="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="20"/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="30"/>
                                </Grid.ColumnDefinitions>
                                <Label Grid.Column="0">0</Label>
                                <Slider Name="ColorBlueSlider" Grid.Column="1" Width="Auto" Maximum="255" TabIndex="16" Value="{Binding Mode=TwoWay,Path=ActivePenSettings.PenColorBlue}" Style="{DynamicResource GraySliderStyle}"></Slider>
                                <Label Grid.Column="2">255</Label>
                            </Grid>
                            <Button Style="{StaticResource ColorButton}"  Name="CurrentColorValue" Grid.Column="1" Grid.RowSpan="3" Margin="5" Command="Commands:RibbonUICommands.SetPenColor" TabIndex="13" Content="Click to change..." Background="{Binding Mode=OneWay,Path=ActivePenSettings.PenBrush}">
                            </Button>

                        </Grid>
                    </Border>

                </Grid>
            </Expander>
            <r:Ribbon Title="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=Title}" Name="MainRibbonMenu" DockPanel.Dock="Top">
                <r:Ribbon.Resources>
                    <r:RibbonGroupSizeDefinitionCollection x:Key="RibbonLayout">
                        <r:RibbonGroupSizeDefinition>
                            <!-- Control sizes: L,L,L -->
                            <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                        </r:RibbonGroupSizeDefinition>
                        <r:RibbonGroupSizeDefinition>
                            <!-- Control sizes: L,M,M -->
                            <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                        </r:RibbonGroupSizeDefinition>
                        <r:RibbonGroupSizeDefinition>
                            <!-- Control sizes: L,S,S -->
                            <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                        </r:RibbonGroupSizeDefinition>
                        <!-- Collapsed -->
                        <r:RibbonGroupSizeDefinition IsCollapsed="True" />
                    </r:RibbonGroupSizeDefinitionCollection>
                    <!-- Define the application icon in the org -->
                </r:Ribbon.Resources>
                <r:Ribbon.ApplicationMenu>
                    <r:RibbonApplicationMenu>
                        <r:RibbonApplicationMenu.Command>
                            <r:RibbonCommand 
								LabelTitle="Application Button"
								ToolTipTitle="ActiveStory Enhanced"
								ToolTipDescription="Click here to open or save a project." 
								LargeImageSource="Content/icon.png" 
								SmallImageSource="Content/icon.png" />
                        </r:RibbonApplicationMenu.Command>
                        <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.NewProject" />
                        <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.SaveProject" />
                        <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.OpenProject" />
                        <r:RibbonApplicationSplitMenuItem Command="Commands:RibbonUICommands.ExportProject" CommandParameter="0">
                            <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.ExportToWizardOfOz" CommandParameter="0"></r:RibbonApplicationMenuItem>
                            <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.ExportPageToImage" CommandParameter="1"></r:RibbonApplicationMenuItem>
                            <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.ExportAllToImage" CommandParameter="2"></r:RibbonApplicationMenuItem>
                        </r:RibbonApplicationSplitMenuItem>
                        <r:RibbonApplicationSplitMenuItem>
                            <r:RibbonApplicationSplitMenuItem.Command>
                                <r:RibbonCommand x:Name="InterfaceMenu" LabelTitle="Interface Style" ToolTipTitle="Interface Style" 
												 ToolTipDescription="Select the style for the interface."
												 CanExecute="InterfaceMenu_CanExecute" Executed="BlackRibbonStyleCommandBinding_Executed"
												 />
                            </r:RibbonApplicationSplitMenuItem.Command>
                            <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.BlackRibbon"></r:RibbonApplicationMenuItem>
                            <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.BlueRibbon"></r:RibbonApplicationMenuItem>
                            <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.SilverRibbon"></r:RibbonApplicationMenuItem>
                            <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.Win7Ribbon"></r:RibbonApplicationMenuItem>
                        </r:RibbonApplicationSplitMenuItem>
                        <r:RibbonApplicationMenuItem Command="Commands:RibbonUICommands.ExitActiveStory" />
                    </r:RibbonApplicationMenu>
                </r:Ribbon.ApplicationMenu>

                <!-- Quick pick menu -->
                <r:Ribbon.QuickAccessToolBar>
                    <r:RibbonQuickAccessToolBar CanUserCustomize="True">
                        <r:RibbonButton Command="Commands:RibbonUICommands.NewProject" r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                        <r:RibbonButton Command="Commands:RibbonUICommands.SaveProject" r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                        <r:RibbonButton Command="Commands:RibbonUICommands.OpenProject" r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                        <r:RibbonSeparator></r:RibbonSeparator>
                        <r:RibbonButton Command="Commands:RibbonUICommands.Undo" r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                        <r:RibbonButton Command="Commands:RibbonUICommands.Redo" r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                    </r:RibbonQuickAccessToolBar>
                </r:Ribbon.QuickAccessToolBar>

                <!--Tabs -->
                <r:RibbonTab Label="Tools" Name="ToolsRibbonTab">
                    <r:RibbonTab.Groups>
                        <r:RibbonGroup Name="DrawModeRibbonGroup" GroupSizeDefinitions="{StaticResource RibbonLayout}">
                            <r:RibbonGroup.Command>
                                <r:RibbonCommand LabelTitle="Pen Mode"/>
                            </r:RibbonGroup.Command>
                            <r:RibbonButton Command="Commands:RibbonUICommands.DrawMode"></r:RibbonButton>
                            <r:RibbonButton Command="Commands:RibbonUICommands.PointEraserMode"></r:RibbonButton>
                            <r:RibbonButton Command="Commands:RibbonUICommands.StrokeEraserMode"></r:RibbonButton>
                            <r:RibbonButton Command="Commands:RibbonUICommands.SelectionMode"></r:RibbonButton>
                        </r:RibbonGroup>

                        <r:RibbonGroup Name="ExportRibbonGroup" GroupSizeDefinitions="{StaticResource RibbonLayout}" Command="Commands:RibbonUICommands.ExportProject" CommandParameter="0" HasDialogLauncher="True">
                            <r:RibbonButton Command="Commands:RibbonUICommands.ExportToWizardOfOz" CommandParameter="0"></r:RibbonButton>
                            <r:RibbonButton Command="Commands:RibbonUICommands.ExportPageToImage" CommandParameter="1"></r:RibbonButton>
                            <r:RibbonButton Command="Commands:RibbonUICommands.ExportAllToImage" CommandParameter="2"></r:RibbonButton>
                        </r:RibbonGroup>



                    </r:RibbonTab.Groups>
                </r:RibbonTab>
                <!-- Page Ribbon tab -->
                <r:RibbonTab Label="Page" Name="PageRibbonTab">
                    <r:RibbonTab.Groups>
                        <r:RibbonGroup Name="PageRibbonGroup" GroupSizeDefinitions="{StaticResource RibbonLayout}">
                            <r:RibbonGroup.Command>
                                <r:RibbonCommand LabelTitle="Page"/>
                            </r:RibbonGroup.Command>
                            <r:RibbonButton Command="Commands:RibbonUICommands.AddPage"></r:RibbonButton>
                            <r:RibbonButton Command="Commands:RibbonUICommands.DeletePage"></r:RibbonButton>
                            <r:RibbonButton Command="Commands:RibbonUICommands.CarbonCopyPage"></r:RibbonButton>
                        </r:RibbonGroup>
                    </r:RibbonTab.Groups>
                </r:RibbonTab>
            </r:Ribbon>
        </DockPanel>
        <!--Bottom panel, Page thumbnail list, status bar-->
        <DockPanel DockPanel.Dock="Bottom">
            <DockPanel.Background>
                <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
            </DockPanel.Background>
            <!--status bar's dock panel-->
            <Border DockPanel.Dock="Bottom" BorderThickness="1">
                <Border.BorderBrush>
                    <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                </Border.BorderBrush>
                <DockPanel LastChildFill="True">
                    <!--Left aligned side of statusbar-->
                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
                        <Border BorderBrush="SlateGray" BorderThickness="1,1,2,1" CornerRadius="0,0,0,10">
                            <Label Name="ModeLabel" >Mode:</Label>
                        </Border>
                        <Border BorderBrush="SlateGray" BorderThickness="0,1,3,1" CornerRadius="0,0,10,0">
                            <Label Name="ModeValueLabel" Content="{Binding Mode=OneWay,Path=ActivePenMode, Converter={StaticResource PenModeConverter}}"></Label>
                        </Border>
                    </StackPanel>
                    <!-- Right aligned side of statusbar-->
                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
                        <Border BorderBrush="SlateGray" BorderThickness="3,1,2,1" CornerRadius="0,0,0,10">
                            <Label Name="ZoomStatusBarLabel">Zoom:</Label>
                        </Border>
                        <Border BorderBrush="SlateGray" BorderThickness="0,1,3,1" CornerRadius="0,0,10,0" Width="40">
                            <Label Name="ZoomValueStatusLabel" HorizontalContentAlignment="Center" Content="{Binding ElementName=ZoomSlider,Path=Value}" ContentStringFormat="G2"></Label>
                        </Border>
                        <Border BorderBrush="SlateGray" BorderThickness="3,1,3,1" CornerRadius="0,0,10,10" Width="200">
                            <DockPanel>
                                <Image DockPanel.Dock="Left" Height="20" HorizontalAlignment="Center" Source="Content/Zoom_Out.png"/>
                                <Image DockPanel.Dock="Right" Height="20" HorizontalAlignment="Center" Source="Content/Zoom_In.png"/>
                                <Slider Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Center" Name="ZoomSlider" Value="1" Minimum="0.1" Maximum="5" IsSnapToTickEnabled="True" TickFrequency="0.1" TabIndex="16" TickPlacement="Both"></Slider>
                            </DockPanel>
                        </Border>
                    </StackPanel>
                    <!-- Middle of status bar... empty for now -->
                    <Grid>
                    </Grid>
                </DockPanel>
            </Border>
            <!--Page list box-->
            <Expander DockPanel.Dock="Top" ExpandDirection="Up" IsExpanded="True" Header="Pages">
                <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                    <ListBox x:Name="PagesListBox" Height="95" BorderBrush="{x:Null}" ItemsPanel="{DynamicResource HorizontalListBoxItemsPanelTemplate}" ItemTemplate="{DynamicResource PageListBoxDataTemplate}" ItemsSource="{Binding Path=CurrentProject.PageDictionary.ValueObservableCollection}" ItemContainerStyle="{DynamicResource ListBoxItemStyle}" Foreground="White" SelectionChanged="PagesListBox_SelectionChanged">
                    <ListBox.Background>
                        <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                    </ListBox.Background>
                    <!--<ListBox.Items>
                    <ListBoxItem Content="Test" Margin="3"></ListBoxItem>
                    <ListBoxItem Content="Test" Margin="3"></ListBoxItem>
                    <ListBoxItem Content="Test" Margin="3"></ListBoxItem>
                    <ListBoxItem Content="Test" Margin="3"></ListBoxItem>
                </ListBox.Items>-->
                </ListBox>
                </Grid>
            </Expander>
        </DockPanel>
        <!--Left panel, Toolbox-->
        <Expander DockPanel.Dock="Left" ExpandDirection="Right" IsExpanded="True">
            <Expander.Header>
                <TextBlock Text="Toolbox" RenderTransformOrigin="0.5,0.5">
			        <TextBlock.LayoutTransform>
				        <TransformGroup>
					        <ScaleTransform ScaleX="1" ScaleY="1"/>
					        <SkewTransform AngleX="0" AngleY="0"/>
					        <RotateTransform Angle="90"/>
					        <TranslateTransform X="0" Y="0"/>
				        </TransformGroup>
			        </TextBlock.LayoutTransform>
			        <TextBlock.RenderTransform>
				        <TransformGroup>
					        <ScaleTransform ScaleX="1" ScaleY="1"/>
					        <SkewTransform AngleX="0" AngleY="0"/>
					        <RotateTransform Angle="0"/>
					        <TranslateTransform X="0" Y="0"/>
				        </TransformGroup>
			        </TextBlock.RenderTransform>
                </TextBlock>
            </Expander.Header>

            <Expander.Background>
                <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
            </Expander.Background>
            <StackPanel Orientation="Vertical">
                <StackPanel.Background>
                    <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                </StackPanel.Background>
                <DockPanel LastChildFill="True">
                    <Image Source="Content\Control_Button.png" Width="17" Margin="10,5,2,5" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                    <Label Name="ButtonHotspotToolLabel">Button/Hotspot</Label>
                </DockPanel>
                <DockPanel LastChildFill="True">
                    <Image Source="Content\Control_Image.png" Width="17" Margin="10,5,2,5" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                    <Label>Image</Label>
                </DockPanel>
                <DockPanel LastChildFill="True">
                    <Image Source="Content\Control_TextBox.png" Width="17" Margin="10,5,2,5" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                    <Label>Text Box</Label>
                </DockPanel>
                <DockPanel LastChildFill="True">
                    <Image Source="Content\Label.png" Width="17" Margin="10,5,2,5" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                    <Label>Label</Label>
                </DockPanel>
                <DockPanel LastChildFill="True">
                    <Image Source="Content/Control_ListBox.png" Width="17" Margin="10,5,2,5" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                    <Label>List Box</Label>
                </DockPanel>
                <DockPanel LastChildFill="True">
                    <Image Source="Content/Control_CheckBox.png" Width="17" Margin="10,5,2,5" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                    <Label>Check Box</Label>
                </DockPanel>
                <DockPanel LastChildFill="True">
                    <Image Source="Content\Control_RadioButton.png" Width="17" Margin="10,5,2,5" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                    <Label>Radio Button</Label>
                </DockPanel>
            </StackPanel>
        </Expander>
        <!--Right panel, Element list-->
        <Expander DockPanel.Dock="Right" ExpandDirection="Left" IsExpanded="True">
            <Expander.Header>
                <TextBlock Text="Objects" RenderTransformOrigin="0.5,0.5">
			<TextBlock.LayoutTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="-90"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</TextBlock.LayoutTransform>
			<TextBlock.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</TextBlock.RenderTransform>
                </TextBlock>
            </Expander.Header>

            <Expander.Background>
                <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
            </Expander.Background>
            <Grid MaxWidth="250" Width="250">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TreeView Grid.Row="0" BorderBrush="{x:Null}" x:Name="ObjectsTreeView" SelectedItemChanged="ObjectsTreeView_SelectedItemChanged" Visibility="Hidden">
                    <TreeView.Background>
                        <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                    </TreeView.Background>
                    <TreeView.Items>
                        <TreeViewItem Header="Test">
                            <TreeViewItem Header="SubItem"></TreeViewItem>
                        </TreeViewItem>
                    </TreeView.Items>
                </TreeView>
                <GridSplitter ShowsPreview="True" ResizeDirection="Auto" Grid.Row="1" HorizontalAlignment="Stretch" Height="3" Visibility="Hidden"/>
                <TabControl Grid.Row="0" Grid.RowSpan="3" IsManipulationEnabled="True" BorderBrush="{x:Null}">
                    <TabControl.Background>
                        <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                    </TabControl.Background>
                    <TabItem>
                        <TabItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Image Source="Content/Properties.png" Width="15"></Image>
                                <Label>Properties</Label>
                            </StackPanel>
                        </TabItem.Header>
                        <pg:PropertyGrid x:Name="PropertiesPropertyGrid" ShowDescription="True">
                            <pg:PropertyGrid.Background>
                                <SolidColorBrush Color="{DynamicResource BabyBlueBackgroundColor}"/>
                            </pg:PropertyGrid.Background>

                        </pg:PropertyGrid>
                    </TabItem>
                    <TabItem>
                        <TabItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Image Source="/ActiveStoryTouch;component/Content/VSObject_Event.png" Width="15"></Image>
                                <Label>Triggers</Label>
                            </StackPanel>
                        </TabItem.Header>
                        <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto">
                            <Grid Name="TriggersGrid">
                                <Grid.RowDefinitions>

                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="1*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                            </Grid>

                        </ScrollViewer>
                    </TabItem>
                </TabControl>

            </Grid>
        </Expander>
        <!--Center panel, InkCanvas-->
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <Border>
                <Border.LayoutTransform>
                    <ScaleTransform ScaleX="{Binding ElementName=ZoomSlider, Path=Value}" ScaleY="{Binding ElementName=ZoomSlider, Path=Value}"/>
                </Border.LayoutTransform>
                <Border Name="InkCanvasBorder" BorderBrush="Black" Height="600" Width="800">
                    <InkCanvas Name="PageInkCanvas" AllowDrop="True" Drop="PageInkCanvas_Drop" SelectionChanged="PageInkCanvas_SelectionChanged" />
                </Border>
            </Border>
        </ScrollViewer>
    </DockPanel>
</r:RibbonWindow>
